<template>
 <div>
   <div class="reco_title">热销推荐</div>
   <ul><!--把router-link>替换成li-->
     <router-link
       class="item"
       v-for="item of reco"
       :key="item.id"
       tag="li"
       :to="'/detail/' + item.id"
     >
       <img class="item_img" :src="item.imgUrl"/>
       <div class="item_cont border-bottom"><!--1像素边框的引用 border-botom-->
         <p class="item_title">{{item.title}}</p>
         <p class="item_desc">{{item.desc}}</p>
         <button class="item_but">查看详情</button>
       </div>
     </router-link>
   </ul>
 </div>
</template>

<script>
export default {
  name: 'HomeRemcommend',
  props: {
    reco: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/mixins.styl"
  .reco_title
    line-height: .7rem
    background:  #eee
    text-indent: .2rem/*缩进*/
  .item
    display: flex
    overflow: hidden
    height: 1.9rem
    .item_img
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .item_cont
      flex: 1
      padding: .1rem
      min-width: 0
      .item_title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .item_desc
        line-height: .4rem
        color: gainsboro
        ellipsis()
      .item_but
        line-height: .44rem
        background: #ff9300
        padding: .03rem .15rem
        border-radius: .06rem
        color: #fff
        margin-top: .2rem
        font-size: .24rem
</style>
